package com.ruoyi.lclook.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lclook.mapper.AdMessageMapper;
import com.ruoyi.lclook.domain.AdMessage;
import com.ruoyi.lclook.service.IAdMessageService;

/**
 * 落地页留言Service业务层处理
 * 
 * @author Choi
 * @date 2021-08-17
 */
@Service
public class AdMessageServiceImpl implements IAdMessageService 
{
    @Autowired
    private AdMessageMapper adMessageMapper;

    /**
     * 查询落地页留言
     * 
     * @param id 落地页留言ID
     * @return 落地页留言
     */
    @Override
    public AdMessage selectAdMessageById(Long id)
    {
        return adMessageMapper.selectAdMessageById(id);
    }

    /**
     * 查询落地页留言列表
     * 
     * @param adMessage 落地页留言
     * @return 落地页留言
     */
    @Override
    public List<AdMessage> selectAdMessageList(AdMessage adMessage)
    {
        return adMessageMapper.selectAdMessageList(adMessage);
    }

    /**
     * 新增落地页留言
     * 
     * @param adMessage 落地页留言
     * @return 结果
     */
    @Override
    public int insertAdMessage(AdMessage adMessage)
    {
        adMessage.setCreateTime(DateUtils.getNowDate());
        return adMessageMapper.insertAdMessage(adMessage);
    }

    /**
     * 修改落地页留言
     * 
     * @param adMessage 落地页留言
     * @return 结果
     */
    @Override
    public int updateAdMessage(AdMessage adMessage)
    {
        adMessage.setUpdateTime(DateUtils.getNowDate());
        return adMessageMapper.updateAdMessage(adMessage);
    }

    /**
     * 批量删除落地页留言
     * 
     * @param ids 需要删除的落地页留言ID
     * @return 结果
     */
    @Override
    public int deleteAdMessageByIds(Long[] ids)
    {
        return adMessageMapper.deleteAdMessageByIds(ids);
    }

    /**
     * 删除落地页留言信息
     * 
     * @param id 落地页留言ID
     * @return 结果
     */
    @Override
    public int deleteAdMessageById(Long id)
    {
        return adMessageMapper.deleteAdMessageById(id);
    }
}
